<?php /* 程序侠版权所有 技术论坛支持: bbs.chengxuxia.com QQ: 573907419 正版授权防止出现漏洞后门
-- enphp : https://git.oschina.net/mz/mzphp2
 */

namespace app\common\controller;
error_reporting(E_ALL ^ E_NOTICE);
error_reporting(E_ALL ^ E_NOTICE);
use think\Exception;
use think\Controller;
use think\Response;

class Common extends Controller
{
    protected function _initialize()
    {

        if (!is_file(ROOT_PATH . 'data/install.lock')) {
            $var_3 = '<meta http-equiv=\'Refresh\' content=\'0;URL=' . $this->request->baseFile() . '?s=/install/index/index.html\'>';
            exit($var_3);
        }
    }

    protected function _page($var_4, $var_5, $var_6 = null, $var_7 = null, $var_8 = false, $var_9 = [])
    {

        if (empty($var_9)) {
            $var_9 = ['var_page' => 'page', 'path' => $this->request->baseUrl(), 'query' => $this->request->param(), 'fragment' => '',];
        }
        $var_12 = new \think\paginator\driver\Bootstrap($var_4, $var_5, $var_6, $var_7, $var_8, $var_9);
        return $var_12;
    }

    protected function _license()
    {
        $var_14 = $_SERVER['HTTP_HOST'];
        $var_15 = [];
        preg_match('/[\\w][\\w-]*\\.(?:com\\.cn|com|cn|net|co|org|top|shop|trade|cc|name|info|me|news|pw|la|hk|dk|xin|so|win|in|de|wang|asia|biz|mobi|ren|club|site|space|cm|online|tech|xyz|cn\\.com|com\\.cn|net\\.cn|org\\.cn|gov\\.cn|com\\.hk|tm|tv|tel|us|bid|ai|tw|website|host|tk|vip|link|press|click|kim|store|vc|re|com\\.tw)(\\/|$)/isU', $var_14, $var_15);
        if ($var_15 && is_array($var_15)) {
            $var_16 = rtrim($var_15[0], '/');
        } else {
            $var_17 = str_replace('http://', '', $var_14);
            $var_18 = explode('/', $var_17);
            $var_16 = $var_18[0];
        }
        $var_16 = trim($var_16);
        $var_19 = array($var_16, 'author-st-chengxuxia.com-base-cxxiacms');
        sort($var_19, SORT_STRING);
        $var_20 = strtoupper(substr(sha1(implode($var_19)), 13, 20));
        if (trim(get_config('WEB_AUTH_CODE')) != $var_20) {
            header('Content-Type:text/html; charset=utf-8');
            die('您的网站未被授权，请联系程序侠官网授权，程序侠官网：<a href=\'http:\\/\\/bbs.chengxuxia.com/\' target=\'_blank\'>bbs.chengxuxia.com</a> &nbsp;客服QQ：<a href=\'http://wpa.qq.com/msgrd?v=3&uin=573907419&site=qq&menu=yes\' target=\'_blank\'>573907419</a> &nbsp;客服旺旺：<a target=\'_blank\' href=\'http:\\/\\/www.taobao.com\\/webww\\/ww.php?ver=3&touid=moxie1314
    &siteid=cntaobao&status=1&charset=utf-8\'>moxie1314</a> <br><br> [备注:程序侠官网提供]');
        }
    }

    protected function _curl($var_21, $var_22 = null)
    {
        $var_24 = curl_init();
        curl_setopt($var_24, CURLOPT_URL, $var_21);
        curl_setopt($var_24, CURLOPT_FAILONERROR, !1);
        curl_setopt($var_24, CURLOPT_RETURNTRANSFER, !0);
        if (strlen($var_21) > 5 && strtolower(substr($var_21, 0, 5)) == 'https') {
            curl_setopt($var_24, CURLOPT_SSL_VERIFYPEER, !1);
            curl_setopt($var_24, CURLOPT_SSL_VERIFYHOST, !1);
        }
        if (is_array($var_22) && 0 < count($var_22)) {
            $var_25 = '';
            $var_26 = !1;
            foreach ($var_22 as $var_27 => $var_28) {
                if ('@' != substr($var_28, 0, 1)) {
                    $var_25 .= "$var_27=" . urlencode($var_28) . '&';
                } else {
                    $var_26 = !0;
                }
            }
            unset($var_27, $var_28);
            curl_setopt($var_24, CURLOPT_POST, !0);
            if ($var_26) {
                curl_setopt($var_24, CURLOPT_POSTFIELDS, $var_22);
            } else {
                curl_setopt($var_24, CURLOPT_POSTFIELDS, substr($var_25, 0, -1));
            }
        }
        $var_29 = curl_exec($var_24);
        if (curl_errno($var_24)) {
            throw new Exception(curl_error($var_24), 0);
        } else {
            $var_30 = curl_getinfo($var_24, CURLINFO_HTTP_CODE);
            if (200 !== $var_30) {
                throw new Exception($var_29, $var_30);
            }
        }
        curl_close($var_24);
        return $var_29;
    }

    protected function ajaxReturn($var_31 = [], $var_32 = "", $var_33 = 1)
    {

        $var_36 = ['code' => $var_33, 'msg' => $var_32, 'data' => $var_31];
        return Response::create($var_36, json);
    }
}

;;;;;;;;;;;;;;;;;;;;